using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Specialized;
using System.Net;
using System.IO;
using System.Web;
using Rest.Http;

namespace Rest.Transport
{
    /// <summary>
    /// POST transport
    /// </summary>
    /// <remarks>
    /// See: http://en.wikipedia.org/wiki/HTTP#Request_message
    /// <p>
    /// Multipart messages: http://en.wikipedia.org/wiki/MIME#Multipart_Messages
    /// </p>
    /// </remarks>
    public class PostRestTransport : RestTransport
    {
        #region Properties
        private String boundary = "PostRequestTransport-" +
            DateTime.Now.ToString("yyyyMMddhHHmmss");
        private System.Text.Encoding characterEncoding = Encoding.UTF8;

        /// <summary>
        /// The boundary for multipart messages
        /// </summary>
        public String Boundary
        {
            get { return boundary; }
            set { boundary = value; }
        }

        /// <summary>
        /// The encoding this class uses, defaults to UTF-8
        /// </summary>
        public Encoding CharacterEncoding
        {
            get { return characterEncoding; }
            set { characterEncoding = value; }
        }
        #endregion

        /// <summary>
        /// ctor
        /// </summary>
        public PostRestTransport()
        {
            HttpMethod = "POST";
            SupportsBody = true;
        }
    }
}
